<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html; charset=UTF-8"); 
%>
<%@page import="java.util.LinkedList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="DTO.sinhvien"%>



<h2 style="width: 100%; height: 50px; text-align: center;">DANH SÁCH SINH VIÊN KHOA CÔNG NGHỆ PHẦN MỀM</h2>  
<script language="javascript">
    function masv()
    {
        var type="";
        for( i = 0; i < document.listform.chkid.length; i++ ){
                if( document.listform.chkid[i].checked == true )
                {
                type += document.listform.chkid[i].value+",";
                }
        }      
        window.location='?page=delete_student&type='+type;
    }
</script>
<div style="width: 100%;">
<div  style="float:right;width: 15%;">
    <select name="loaisinhvien">
    <option value="1">Năm 1</option>
    <option value="2">Năm 2</option>
    <option value="3">Năm 3</option>
    <option value="4">Năm 4</option>
    <option value="5">Năm Cuối</option>
</select>
</div>
</div>
<form name="listform" action="student/delete_student.jsp" method="post">
<table id="rounded-corner" summary="">
    <thead>
    <tr>
            <th scope="col" class="rounded-company">  </th>
            <th scope="col" class="rounded">Mã sinh viên  </th>
            <th scope="col" class="rounded">Tên Sinh Viên </th>
            <th scope="col" class="rounded">email </th>
            <th scope="col" class="rounded">Ngày Sinh </th>
            <th scope="col" class="rounded">Giới Tính </th>
            <th scope="col" class="rounded-q4">Trạng Thái </th>
             <th scope="col" class="rounded-q4">Edit</th>
              <th scope="col" class="rounded-q4">Delete </th>
        </tr>
    </thead>       
    <tbody> 
        <%
DataWS a=new DataWS();
List<dktc_ws.Sinhvien>sv =new LinkedList<dktc_ws.Sinhvien>();
sv=a.laydanhsachsinhvien("-1");

for(int i=1;i<sv.size();i++)
       {
    dktc_ws.Sinhvien item=sv.get(i);
    //out.print(temp.getHoten());
%>

        <tr>
            <td><input type="checkbox" name="chkid" value="<%=item.getMasv().trim() %>"/></td> 
                <td><%=item.getMasv().trim() %></td> 
            <td><%=item.getHoten() %></td> 
            <td><%=item.getEmail() %></td> 
            <td><%=item.getNgaysinh() %></td>
             <td><%=item.getGioitinh() %></td>
              <td><%=item.getTrangthai() %></td>              
            <td><a href="?page=edit_student&id=<%=item.getMasv().trim() %>"><img src="images/user_edit.png" alt="" title="" border="0" /></a></td> 
            <td><a href="?page=delete_student&id=<%=item.getMasv().trim() %>" class="ask"><img src="images/trash.png" alt="" title="" border="0" /></a></td> 
        </tr>      
    	      
        <%}%>         
    </tbody>
</table>
<a href="?page=add_student" class="bt_green"><span class="bt_green_lft"></span><strong>Thêm sinh viên mới</strong><span class="bt_green_r"></span></a> 
     <!--a href="#" class="bt_blue"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a--> 
     <a href="javascript:masv();" class="bt_red" onclick="javascript:masv();"><span class="bt_red_lft"></span><strong>Xóa sinh viên</strong><span class="bt_red_r"></span></a>           
        <div class="pagination"> 
        <span class="disabled">< < prev</span><span class="current">1</span><a href="">2</a><a href="">3</a><a href="">4</a><a href="">5</a>...<a href="">10</a><a href="">11</a><a href="">12</a>...<a href="">100</a><a href="">101</a><a href="">next >></a> 
        </div>      
</form>
